// import { stringify } from "querystring";

const list = [
  { id: 0, dateTime: new Date().valueOf(), router: 'K2', winNum: '001' },
  { id: 1, dateTime: new Date().valueOf(), router: 'K2', winNum: '002' },
  { id: 2, dateTime: new Date().valueOf(), router: 'K11', winNum: '001' },
  { id: 3, dateTime: new Date().valueOf(), router: 'K11', winNum: '002' },
  { id: 4, dateTime: new Date().valueOf(), router: 'P1', winNum: '001' },
  { id: 5, dateTime: new Date().valueOf(), router: 'P1', winNum: '002' },
  { id: 6, dateTime: new Date().valueOf(), router: 'P10', winNum: '001' },
  { id: 7, dateTime: new Date().valueOf(), router: 'P10', winNum: '002' }
]
export default [
  // 查询
  {
    url: '/bdc/route-log',
    type: 'get',
    response: config => {
      const res = config.query
      let data = [].concat(list)
      if (res.winNum && res.winNum !== '') {
        data = data.filter(a => a.winNum.indexOf(res.winNum) >= 0)
      }
      if (res.router && res.router !== '') {
        data = data.filter(a => a.router.indexOf(res.router) >= 0)
      }
      return {
        code: 20000,
        data: data,
        message: JSON.stringify(res)
      }
    }
  }
]

